<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div v-if="crud.props.searchToggle" class="LayoutBox">
        <div class="left">
          <el-select v-model="query.team" clearable size="small" placeholder="选择团队名称搜索" class="filter-item" @change="crud.toQuery">
            <el-option v-for="item in teamTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
          </el-select>
          <el-select v-model="query.website" clearable size="small" placeholder="选择网站名称搜索" class="filter-item" @change="crud.toQuery">
            <el-option v-for="item in websiteTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
          </el-select>
          <el-select v-model="query.anchor" clearable size="small" placeholder="选择主播昵称搜索" class="filter-item" @change="crud.toQuery">
            <el-option v-for="item in anchorTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
          </el-select>
          <date-range-picker v-model="query.createTime" class="date-item" />
        <!-- <rrOperation /> -->
        </div>
        <div class="right">
          <el-input v-model="query.name" clearable size="small" placeholder="输入关键词搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        </div>
      </div>
      <crudOperation :permission="permission" />
    </div>
    <!--表格渲染-->
    <el-table
      ref="table"
      v-loading="crud.loading"
      :header-cell-style="{
        background:'#f5f7fa',color:'#000000'}"
      border
      :data="crud.data"
      style="width: 100%;"
    >
      <el-table-column v-for="item in Tablelist" :key="item.id" :type="item.type" :width="item.width" :sortable-name="item.sortableName" :align="item.align" :sortable="item.sortable" :show-overflow-tooltip="true" :prop="item.prop" :label="item.label" />
    </el-table>
    <!--分页组件-->
    <pagination />
  </div>
</template>

<script>
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import DateRangePicker from '@/components/DateRangePicker'
import pagination from '@crud/Pagination'
import { Tablelist } from './ElTable'

const defaultForm = { id: null, name: null, creatorId: null, createAt: null, updateAt: null, isDelete: null, deptId: null }
export default {
  name: 'DayDataIndex',
  components: { crudOperation, DateRangePicker, pagination },

  cruds() {
    return CRUD({ url: 'api/jobs', optShow: {
      add: false,
      edit: false,
      del: false,
      reset: false
    }},
    )
  },
  mixins: [presenter(), header(), form(defaultForm), crud()],

  data() {
    return {
      Tablelist,
      delLoading: false,
      // 按钮权限
      permission: {

      },
      //   团队列表
      teamTypeOptions: [
        { key: 'true', display_name: '正常' },
        { key: 'false', display_name: '禁用' }
      ],
      //   网站列表
      websiteTypeOptions: [
        { key: 'true', display_name: '正常' },
        { key: 'false', display_name: '禁用' }
      ],
      //   主播列表
      anchorTypeOptions: [
        { key: 'true', display_name: '正常' },
        { key: 'false', display_name: '禁用' }
      ]
    }
  },
  created() {
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>

</style>
